package Controller.GenderSinger;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.GenderSingerDao;

public class DegooGenderChartContoller implements Controller{
	private GenderSingerDao dao;
	public void setDao(GenderSingerDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("대구 성별 가수 선호도 컨트롤러");
		
		int ka_no = dao.degooSequence();
		System.out.println("대구 시퀀스 값 : " + ka_no);
		List<joinHadoopBean> degoogendersinger = dao.degoogendersinger(ka_no);
		
		for (joinHadoopBean joinHadoopBean : degoogendersinger) {
			System.out.println("-----------------------------------");
			System.out.println("카운터 : "+joinHadoopBean.getAreagslbean().getAgsl_count());
			System.out.println("성별 남자 1 여자 2 : "+joinHadoopBean.getAreagslbean().getAgsl_gender());
			System.out.println("가수 : "+joinHadoopBean.getSingerbean().getS_singer());
			System.out.println("-----------------------------------");
		}
		System.out.println("다오 실행 성공!!");
		ModelAndView mav = new ModelAndView();
		mav.setViewName("degooGenderSinger");
		mav.addObject("degoogendersinger", degoogendersinger);
		return mav;
	}

}
